Skip to content

Conversation

@deepshekhardas
Copy link

@deepshekhardas deepshekhardas commented Feb 2, 2026

Summary

Fixes #2913

Problem

GitHub Integration runs trigger deploy which executes npm install (or equivalent) in a Node 20 environment. If a project has strict engines.node requirements (e.g., "22"), the install phase fails before reaching the Docker build phase where the runtime config is respected.

Fix

  • Updated updateTriggerPackages in packages/cli-v3/src/commands/update.ts to accept an ignoreEngines option.
  • Passed appropriate flags to installDependencies based on package manager:
    • npm: --no-engine-strict
    • pnpm: --config.engine-strict=false
    • yarn: --ignore-engines
  • Updated deploy.ts to pass ignoreEngines: true when running package updates during deployment.

Verification

  • Added unit tests in packages/cli-v3/src/commands/update.test.ts to verify the correct flags are passed.
  • Verified locally via unit tests.

Open with Devin

@changeset-bot
Copy link

changeset-bot bot commented Feb 2, 2026

🦋 Changeset detected

Latest commit: 023c3fd

The changes in this PR will be included in the next version bump.

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 2, 2026

Walkthrough

This pull request introduces engine version check bypass functionality to the CLI during package updates and deployments. A new ignoreEngines flag is added to the UpdateCommandOptions configuration, which conditionally appends package-manager-specific flags (npm: --no-engine-strict, pnpm: --config.engine-strict=false, yarn: --ignore-engines) when installing dependencies. The deploy command is updated to invoke the update function with this flag enabled. A comprehensive test suite validates that the correct engine-related flags are passed to the dependency installer for each supported package manager.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

🚥 Pre-merge checks | ✅ 4 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly describes the main change: ignoring engine checks during deployment install to prevent build server failures, which is the primary objective of the PR.
Description check ✅ Passed The description covers the problem, fix, and verification with code changes clearly mapped to files. However, the PR lacks the standard checklist and screenshot sections from the template.
Linked Issues check ✅ Passed The PR successfully addresses issue #2913 by implementing engine-check bypass flags for npm, pnpm, and yarn, enabling deployments to proceed on build servers with mismatched Node versions.
Out of Scope Changes check ✅ Passed All changes are directly related to fixing issue #2913: the changeset, engine flag implementation, deployment integration, and comprehensive unit tests are all in scope.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

@devin-ai-integration devin-ai-integration bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Devin Review found 1 potential issue.

View issue and 4 additional flags in Devin Review.

Open in Devin Review

export const UpdateCommandOptions = CommonCommandOptions.pick({
logLevel: true,
skipTelemetry: true,
ignoreEngines: true,

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 ignoreEngines property picked from schema that doesn't contain it

The UpdateCommandOptions schema is created by picking ignoreEngines from CommonCommandOptions, but CommonCommandOptions does not define an ignoreEngines property.

Click to expand

Issue

In update.ts:18-22, UpdateCommandOptions is defined as:

export const UpdateCommandOptions = CommonCommandOptions.pick({
  logLevel: true,
  skipTelemetry: true,
  ignoreEngines: true,  // This doesn't exist in CommonCommandOptions!
});

But looking at common.ts:12-17, CommonCommandOptions only has:

export const CommonCommandOptions = z.object({
  apiUrl: z.string().optional(),
  logLevel: z.enum(["debug", "info", "log", "warn", "error", "none"]).default("log"),
  skipTelemetry: z.boolean().default(false),
  profile: z.string().default(readAuthConfigCurrentProfileName()),
});

Zod's .pick() silently ignores non-existent keys, so UpdateCommandOptions won't include ignoreEngines in its schema or type definition.

Impact

When updateTriggerPackages is called from deploy.ts with { ...options, ignoreEngines: true }, the property is passed directly and works. However, the UpdateCommandOptions type doesn't include ignoreEngines, creating a type mismatch. If the standalone update command ever needs to support ignoreEngines, it won't work because the schema won't validate it.

Recommendation

Add ignoreEngines to CommonCommandOptions with a default of false, or use .extend() instead of .pick() to add the property to UpdateCommandOptions.

Recommendation: Either add ignoreEngines: z.boolean().default(false) to CommonCommandOptions in common.ts, or change UpdateCommandOptions to use .extend() to add the property: CommonCommandOptions.pick({ logLevel: true, skipTelemetry: true }).extend({ ignoreEngines: z.boolean().default(false) })

Open in Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.

@vibe-kanban-cloud
Copy link

Review Complete

Your review story is ready!

View Story

Comment !reviewfast on this PR to re-generate the story.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🤖 Fix all issues with AI agents
In `@packages/cli-v3/src/commands/update.test.ts`:
- Around line 10-72: The test file uses forbidden vi.mock/vi.mocked calls
(mocking nypm, pkg-types, fs, `@clack/prompts`, etc.) inside the
describe("updateTriggerPackages") suite; remove all vi.mock/vi.mocked usage and
refactor to an integration-style test: create a temporary project dir (use fs
real methods) and a real package.json with the desired dependencies instead of
mocking pkgTypes.readPackageJSON/resolvePackageJSON, run the actual
updateTriggerPackages flow (the function under test) and invoke real
nypm.installDependencies (or call the CLI path) while using
`@internal/testcontainers` helpers if Redis/Postgres are required, and replace
clack.confirm mocks by programmatically simulating user input or calling the
underlying API in non-interactive mode; ensure you restore any test-only cleanup
in beforeEach/afterEach but do not use vi.mock/vi.mocked anywhere.

In `@packages/cli-v3/src/commands/update.ts`:
- Around line 261-277: The code adds a yarn-specific --ignore-engines flag
unconditionally which breaks on Yarn Berry (v2+); update the logic around
installArgs/packageManager.name so that for "yarn" you first detect the Yarn
major version (e.g., run a quick yarn --version check or use existing
packageManager.version if available) and only push "--ignore-engines" when major
=== 1 (Yarn Classic); for Yarn v2+ skip adding the flag and proceed to call
installDependencies({ cwd: projectPath, silent: true, args: installArgs }) as
before.
📜 Review details

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 1ccb8c1 and 023c3fd.

📒 Files selected for processing (4)
  • .changeset/fix-github-install-node-version-2913.md
  • packages/cli-v3/src/commands/deploy.ts
  • packages/cli-v3/src/commands/update.test.ts
  • packages/cli-v3/src/commands/update.ts
🧰 Additional context used
📓 Path-based instructions (8)
**/*.{ts,tsx}

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

**/*.{ts,tsx}: Use types over interfaces for TypeScript
Avoid using enums; prefer string unions or const objects instead

**/*.{ts,tsx}: Always import tasks from @trigger.dev/sdk, never use @trigger.dev/sdk/v3 or deprecated client.defineJob pattern
Every Trigger.dev task must be exported and have a unique id property with no timeouts in the run function

Files:

  • packages/cli-v3/src/commands/deploy.ts
  • packages/cli-v3/src/commands/update.test.ts
  • packages/cli-v3/src/commands/update.ts
**/*.{ts,tsx,js,jsx}

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

Use function declarations instead of default exports

Import from @trigger.dev/core using subpaths only, never import from root

Files:

  • packages/cli-v3/src/commands/deploy.ts
  • packages/cli-v3/src/commands/update.test.ts
  • packages/cli-v3/src/commands/update.ts
**/*.ts

📄 CodeRabbit inference engine (.cursor/rules/otel-metrics.mdc)

**/*.ts: When creating or editing OTEL metrics (counters, histograms, gauges), ensure metric attributes have low cardinality by using only enums, booleans, bounded error codes, or bounded shard IDs
Do not use high-cardinality attributes in OTEL metrics such as UUIDs/IDs (envId, userId, runId, projectId, organizationId), unbounded integers (itemCount, batchSize, retryCount), timestamps (createdAt, startTime), or free-form strings (errorMessage, taskName, queueName)
When exporting OTEL metrics via OTLP to Prometheus, be aware that the exporter automatically adds unit suffixes to metric names (e.g., 'my_duration_ms' becomes 'my_duration_ms_milliseconds', 'my_counter' becomes 'my_counter_total'). Account for these transformations when writing Grafana dashboards or Prometheus queries

Files:

  • packages/cli-v3/src/commands/deploy.ts
  • packages/cli-v3/src/commands/update.test.ts
  • packages/cli-v3/src/commands/update.ts
**/*.{js,ts,jsx,tsx,json,md,yaml,yml}

📄 CodeRabbit inference engine (AGENTS.md)

Format code using Prettier before committing

Files:

  • packages/cli-v3/src/commands/deploy.ts
  • packages/cli-v3/src/commands/update.test.ts
  • packages/cli-v3/src/commands/update.ts
{packages,integrations}/**/*

📄 CodeRabbit inference engine (CLAUDE.md)

Add a changeset when modifying any public package in packages/* or integrations/* using pnpm run changeset:add

Files:

  • packages/cli-v3/src/commands/deploy.ts
  • packages/cli-v3/src/commands/update.test.ts
  • packages/cli-v3/src/commands/update.ts
**/*.{test,spec}.{ts,tsx}

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

Use vitest for all tests in the Trigger.dev repository

Files:

  • packages/cli-v3/src/commands/update.test.ts
**/*.test.{ts,tsx,js,jsx}

📄 CodeRabbit inference engine (AGENTS.md)

**/*.test.{ts,tsx,js,jsx}: Test files should live beside the files under test and use descriptive describe and it blocks
Tests should avoid mocks or stubs and use the helpers from @internal/testcontainers when Redis or Postgres are needed
Use vitest for running unit tests

**/*.test.{ts,tsx,js,jsx}: Use vitest exclusively for testing and never mock anything - use testcontainers instead
Place test files next to source files with naming pattern: source file (e.g., MyService.ts) → MyService.test.ts

Files:

  • packages/cli-v3/src/commands/update.test.ts
**/*.test.{ts,tsx}

📄 CodeRabbit inference engine (CLAUDE.md)

Use testcontainers helpers (redisTest, postgresTest, containerTest) from @internal/testcontainers for Redis/PostgreSQL testing instead of mocks

Files:

  • packages/cli-v3/src/commands/update.test.ts
🧠 Learnings (14)
📚 Learning: 2026-01-15T11:50:06.067Z
Learnt from: CR
Repo: triggerdotdev/trigger.dev PR: 0
File: CLAUDE.md:0-0
Timestamp: 2026-01-15T11:50:06.067Z
Learning: Applies to {packages,integrations}/**/* : Add a changeset when modifying any public package in `packages/*` or `integrations/*` using `pnpm run changeset:add`

Applied to files:

  • .changeset/fix-github-install-node-version-2913.md
  • packages/cli-v3/src/commands/deploy.ts
  • packages/cli-v3/src/commands/update.test.ts
📚 Learning: 2026-01-15T11:50:06.067Z
Learnt from: CR
Repo: triggerdotdev/trigger.dev PR: 0
File: CLAUDE.md:0-0
Timestamp: 2026-01-15T11:50:06.067Z
Learning: Default to patch version for changesets for bug fixes and minor changes; confirm with maintainers before selecting minor or major

Applied to files:

  • .changeset/fix-github-install-node-version-2913.md
📚 Learning: 2025-11-27T16:27:35.304Z
Learnt from: CR
Repo: triggerdotdev/trigger.dev PR: 0
File: .cursor/rules/writing-tasks.mdc:0-0
Timestamp: 2025-11-27T16:27:35.304Z
Learning: Applies to **/trigger.config.ts : Use build extensions in trigger.config.ts (additionalFiles, additionalPackages, aptGet, prismaExtension, etc.) to customize the build

Applied to files:

  • .changeset/fix-github-install-node-version-2913.md
  • packages/cli-v3/src/commands/deploy.ts
  • packages/cli-v3/src/commands/update.test.ts
📚 Learning: 2025-11-14T19:24:39.536Z
Learnt from: myftija
Repo: triggerdotdev/trigger.dev PR: 2685
File: apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.$projectParam.env.$envParam.settings/route.tsx:1234-1257
Timestamp: 2025-11-14T19:24:39.536Z
Learning: In the trigger.dev project, version validation for the `useNativeBuildServer` setting cannot be performed at the settings form level because the SDK version is only known at build/deployment time, not when saving project settings.

Applied to files:

  • .changeset/fix-github-install-node-version-2913.md
📚 Learning: 2025-11-27T16:27:35.304Z
Learnt from: CR
Repo: triggerdotdev/trigger.dev PR: 0
File: .cursor/rules/writing-tasks.mdc:0-0
Timestamp: 2025-11-27T16:27:35.304Z
Learning: Applies to **/trigger/**/*.{ts,tsx,js,jsx} : Use `trigger.dev/sdk/v3` for all imports in Trigger.dev tasks

Applied to files:

  • .changeset/fix-github-install-node-version-2913.md
  • packages/cli-v3/src/commands/deploy.ts
📚 Learning: 2025-11-27T16:26:58.661Z
Learnt from: CR
Repo: triggerdotdev/trigger.dev PR: 0
File: .cursor/rules/webapp.mdc:0-0
Timestamp: 2025-11-27T16:26:58.661Z
Learning: Applies to apps/webapp/**/*.{ts,tsx} : Follow the Remix 2.1.0 and Express server conventions when updating the main trigger.dev webapp

Applied to files:

  • packages/cli-v3/src/commands/deploy.ts
📚 Learning: 2025-11-27T16:27:35.304Z
Learnt from: CR
Repo: triggerdotdev/trigger.dev PR: 0
File: .cursor/rules/writing-tasks.mdc:0-0
Timestamp: 2025-11-27T16:27:35.304Z
Learning: Applies to **/trigger.config.ts : Configure build process in trigger.config.ts using `build` object with external packages, extensions, and JSX settings

Applied to files:

  • packages/cli-v3/src/commands/deploy.ts
📚 Learning: 2025-11-27T16:27:35.304Z
Learnt from: CR
Repo: triggerdotdev/trigger.dev PR: 0
File: .cursor/rules/writing-tasks.mdc:0-0
Timestamp: 2025-11-27T16:27:35.304Z
Learning: Applies to **/trigger/**/*.{ts,tsx,js,jsx} : Export tasks with unique IDs within the project to enable proper task discovery and execution

Applied to files:

  • packages/cli-v3/src/commands/deploy.ts
📚 Learning: 2025-11-27T16:26:37.432Z
Learnt from: CR
Repo: triggerdotdev/trigger.dev PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-11-27T16:26:37.432Z
Learning: Applies to packages/trigger-sdk/**/*.{ts,tsx} : In the Trigger.dev SDK (packages/trigger-sdk), prefer isomorphic code like fetch and ReadableStream instead of Node.js-specific code

Applied to files:

  • packages/cli-v3/src/commands/deploy.ts
  • packages/cli-v3/src/commands/update.test.ts
📚 Learning: 2026-01-15T11:50:06.067Z
Learnt from: CR
Repo: triggerdotdev/trigger.dev PR: 0
File: CLAUDE.md:0-0
Timestamp: 2026-01-15T11:50:06.067Z
Learning: Applies to **/*.{ts,tsx} : Always import tasks from `trigger.dev/sdk`, never use `trigger.dev/sdk/v3` or deprecated `client.defineJob` pattern

Applied to files:

  • packages/cli-v3/src/commands/deploy.ts
📚 Learning: 2025-11-27T16:27:35.304Z
Learnt from: CR
Repo: triggerdotdev/trigger.dev PR: 0
File: .cursor/rules/writing-tasks.mdc:0-0
Timestamp: 2025-11-27T16:27:35.304Z
Learning: Applies to **/trigger.config.ts : Configure Trigger.dev project in `trigger.config.ts` using `defineConfig()` with project ref and task directories

Applied to files:

  • packages/cli-v3/src/commands/deploy.ts
📚 Learning: 2025-11-27T16:26:44.496Z
Learnt from: CR
Repo: triggerdotdev/trigger.dev PR: 0
File: .cursor/rules/executing-commands.mdc:0-0
Timestamp: 2025-11-27T16:26:44.496Z
Learning: For running tests, navigate into the package directory and run `pnpm run test --run` to enable single-file test execution (e.g., `pnpm run test ./src/engine/tests/ttl.test.ts --run`)

Applied to files:

  • packages/cli-v3/src/commands/update.test.ts
📚 Learning: 2025-11-27T16:26:37.432Z
Learnt from: CR
Repo: triggerdotdev/trigger.dev PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-11-27T16:26:37.432Z
Learning: Applies to **/*.{test,spec}.{ts,tsx} : Use vitest for all tests in the Trigger.dev repository

Applied to files:

  • packages/cli-v3/src/commands/update.test.ts
📚 Learning: 2026-01-15T11:50:06.067Z
Learnt from: CR
Repo: triggerdotdev/trigger.dev PR: 0
File: CLAUDE.md:0-0
Timestamp: 2026-01-15T11:50:06.067Z
Learning: Applies to **/*.test.{ts,tsx,js,jsx} : Use vitest exclusively for testing and never mock anything - use testcontainers instead

Applied to files:

  • packages/cli-v3/src/commands/update.test.ts
🧬 Code graph analysis (2)
packages/cli-v3/src/commands/deploy.ts (2)
packages/cli-v3/src/commands/update.ts (1)
  • updateTriggerPackages (51-304)
packages/cli-v3/src/utilities/cliOutput.ts (5)
  • isLinksSupported (7-7)
  • chalkError (24-26)
  • cliLink (140-145)
  • chalkWarning (28-30)
  • chalkGrey (20-22)
packages/cli-v3/src/commands/update.test.ts (1)
packages/cli-v3/src/commands/update.ts (1)
  • updateTriggerPackages (51-304)
🔇 Additional comments (5)
.changeset/fix-github-install-node-version-2913.md (1)

1-5: Patch changeset looks correct.

Thanks for adding the patch-level changeset for the CLI bug fix.
Based on learnings: Add a changeset when modifying any public package in packages/* or integrations/* using pnpm run changeset:add; Default to patch version for changesets for bug fixes and minor changes; confirm with maintainers before selecting minor or major.

packages/cli-v3/src/commands/update.test.ts (1)

74-112: Good coverage of engine-flag permutations.

The npm/pnpm/yarn cases plus the default path give solid coverage of the new behavior.

packages/cli-v3/src/commands/update.ts (1)

18-22: Option addition is clean and minimal.

Adding ignoreEngines to UpdateCommandOptions is straightforward and keeps the config surface tight.

packages/cli-v3/src/commands/deploy.ts (2)

255-255: Deploy now correctly opts out of engine checks.

Passing ignoreEngines: true during deployment aligns with the build-server mismatch scenario.


492-493: Behavior-preserving string refactors look good.

These interpolation/formatting tweaks keep URLs and output intact while improving readability.

Also applies to: 709-712, 734-735, 742-743, 786-787, 1086-1087, 1153-1155, 1200-1203, 1236-1237, 1251-1253, 1277-1283, 1295-1297, 1314-1316, 1333-1335, 1340-1342, 1359-1365

✏️ Tip: You can disable this entire section by setting review_details to false in your review settings.

Comment on lines +10 to +72
// Mock dependencies
vi.mock("nypm");
vi.mock("pkg-types");
vi.mock("node:fs/promises");
vi.mock("@clack/prompts");
vi.mock("std-env", () => ({
hasTTY: true,
isCI: false,
}));
vi.mock("../utilities/initialBanner.js", () => ({
updateCheck: vi.fn().mockResolvedValue(undefined),
printStandloneInitialBanner: vi.fn(),
}));
vi.mock("../version.js", () => ({
VERSION: "3.0.0",
}));
vi.mock("../cli/common.js", () => ({
CommonCommandOptions: { pick: () => ({}) },
}));
vi.mock("../utilities/cliOutput.js", () => ({
chalkError: vi.fn(),
prettyError: vi.fn(),
prettyWarning: vi.fn(),
}));
vi.mock("../utilities/fileSystem.js", () => ({
removeFile: vi.fn(),
writeJSONFilePreserveOrder: vi.fn(),
}));
vi.mock("../utilities/logger.js", () => ({
logger: {
debug: vi.fn(),
log: vi.fn(),
table: vi.fn(),
},
}));
vi.mock("../utilities/windows.js", () => ({
spinner: () => ({
start: vi.fn(),
message: vi.fn(),
stop: vi.fn(),
}),
}));

describe("updateTriggerPackages", () => {
beforeEach(() => {
vi.resetAllMocks();

// Default mocks
vi.mocked(fs.writeFile).mockResolvedValue(undefined);
vi.mocked(fs.rm).mockResolvedValue(undefined);
vi.mocked(pkgTypes.readPackageJSON).mockResolvedValue({
dependencies: {
"@trigger.dev/sdk": "2.0.0", // Mismatch
},
});
vi.mocked(pkgTypes.resolvePackageJSON).mockResolvedValue("/path/to/package.json");
vi.mocked(clack.confirm).mockResolvedValue(true); // User confirms update
vi.mocked(nypm.installDependencies).mockResolvedValue(undefined);
});

afterEach(() => {
vi.clearAllMocks();
});
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

Mocks are prohibited by repo testing guidelines.

This test suite relies heavily on vi.mock / vi.mocked, which the repository rules disallow. Please refactor to avoid mocks (e.g., integration-style tests with temp dirs/real dependencies, or testcontainers where applicable).
As per coding guidelines: **/*.test.{ts,tsx,js,jsx}: Use vitest exclusively for testing and never mock anything - use testcontainers instead; Tests should avoid mocks or stubs and use the helpers from @internal/testcontainers when Redis or Postgres are needed.

🤖 Prompt for AI Agents
In `@packages/cli-v3/src/commands/update.test.ts` around lines 10 - 72, The test
file uses forbidden vi.mock/vi.mocked calls (mocking nypm, pkg-types, fs,
`@clack/prompts`, etc.) inside the describe("updateTriggerPackages") suite; remove
all vi.mock/vi.mocked usage and refactor to an integration-style test: create a
temporary project dir (use fs real methods) and a real package.json with the
desired dependencies instead of mocking
pkgTypes.readPackageJSON/resolvePackageJSON, run the actual
updateTriggerPackages flow (the function under test) and invoke real
nypm.installDependencies (or call the CLI path) while using
`@internal/testcontainers` helpers if Redis/Postgres are required, and replace
clack.confirm mocks by programmatically simulating user input or calling the
underlying API in non-interactive mode; ensure you restore any test-only cleanup
in beforeEach/afterEach but do not use vi.mock/vi.mocked anywhere.

Comment on lines +261 to +277
const installArgs: string[] = [];

if (options.ignoreEngines && packageManager) {
switch (packageManager.name) {
case "npm":
installArgs.push("--no-engine-strict");
break;
case "pnpm":
installArgs.push("--config.engine-strict=false");
break;
case "yarn":
installArgs.push("--ignore-engines");
break;
}
}

await installDependencies({ cwd: projectPath, silent: true, args: installArgs });
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

# First, let's find the installDependencies function and understand the context
fd -t f "installDependencies" --exec rg -l "installDependencies" {} \;

Repository: triggerdotdev/trigger.dev

Length of output: 51


🏁 Script executed:

# Let's check the update.ts file to see imports and context
cat -n packages/cli-v3/src/commands/update.ts | head -50

Repository: triggerdotdev/trigger.dev

Length of output: 2521


🏁 Script executed:

# Search for nypm usage in the codebase
rg "nypm|detectPackageManager" -t ts -t js --max-count=20

Repository: triggerdotdev/trigger.dev

Length of output: 2226


🏁 Script executed:

# Let's see the full context around lines 261-277 in update.ts
sed -n '240,290p' packages/cli-v3/src/commands/update.ts | cat -n

Repository: triggerdotdev/trigger.dev

Length of output: 1998


🏁 Script executed:

# Let's check the test file to see what flags are being verified
cat -n packages/cli-v3/src/commands/update.test.ts | grep -A 10 -B 5 "ignoreEngines\|installArgs\|--no-engine-strict\|engine-strict\|ignore-engines"

Repository: triggerdotdev/trigger.dev

Length of output: 2256


🏁 Script executed:

# Let's find if there are any inline comments or documentation about these flags
rg "no-engine-strict|engine-strict|ignore-engines" packages/cli-v3 -B 2 -A 2

Repository: triggerdotdev/trigger.dev

Length of output: 3185


🌐 Web query:

npm install --no-engine-strict flag documentation

💡 Result:

--no-engine-strict is the negated form of npm’s boolean engine-strict configuration, so it disables strict engine checks for that command invocation (equivalent to --engine-strict=false). The engine-strict setting controls whether npm refuses to install packages whose declared engines don’t match your current Node.js version. [1]

You can also set it persistently via npm config (e.g., in .npmrc) using engine-strict=false (or enable it with engine-strict=true). [1]

Docs: npm config option engine-strict (applies to npm install, and can be toggled with --engine-strict / --no-engine-strict). [1]

Sources
[1] npm Docs – CLI config (engine-strict): https://docs.npmjs.com/cli/v11/using-npm/config


🌐 Web query:

pnpm install --config.engine-strict=false flag documentation

💡 Result:

--config.<key>=<value> is pnpm’s documented escape hatch for passing “unknown” CLI options through as npm_config_* environment variables (some packages read these during install). Example from the pnpm CLI docs: pnpm install --config.target_arch=x64. [1]

engine-strict itself is a pnpm setting (from .npmrc settings): when engine-strict=true, pnpm refuses to install packages whose engines claim incompatibility with the current Node version (default is false). [2]

So pnpm install --config.engine-strict=false is using that --config.<key> mechanism [1] with the engine-strict setting name [2]. If you want to set it persistently (instead of per-command), use pnpm config management: pnpm config set engine-strict false (optionally with --location=project / --global). [3]

Sources: pnpm CLI “Differences vs npm” (--config.<key>), pnpm .npmrc settings (engine-strict), pnpm config command. [1] [2] [3]


🌐 Web query:

yarn install --ignore-engines flag support classic berry

💡 Result:

  • Yarn Classic (v1): yarn install --ignore-engines is supported (it “Ignore[s] engines check”). [1]
  • Yarn Berry (v2+): yarn install does not support --ignore-engines (Berry’s documented install options don’t include it). [2] Tools that pass old v1 --ignore-* flags to Berry installs can fail with “Unsupported option name …” errors. [3]

Sources:
[1] Yarn Classic yarn install --ignore-engines docs: (classic.yarnpkg.com)
[2] Yarn (Berry) yarn install options list: (yarnpkg.com)
[3] Example of Berry rejecting v1-style --ignore-* flags during yarn install: (github.com)

Citations:


🌐 Web query:

nypm detectPackageManager package manager name values

💡 Result:

In nypm, detectPackageManager() returns a PackageManager object whose name is typed as:

  • "npm"
  • "yarn"
  • "pnpm"
  • "bun"
  • "deno" [1]

Source: PackageManagerName = "npm" | "yarn" | "pnpm" | "bun" | "deno" in nypm’s published TypeScript definitions. [1]

References

[1] https://app.unpkg.com/nypm@0.5.2/files/dist/index.d.mts


Yarn Berry does not support --ignore-engines flag.

The flags for npm and pnpm are correct, but yarn --ignore-engines only works with Yarn Classic (v1). Yarn Berry (v2+) does not recognize this flag and will fail with "Unsupported option name" errors. Since nypm's detectPackageManager returns "yarn" for both versions without distinguishing between them, users with Yarn Berry will encounter silent failures or errors when --ignoreEngines is enabled. Consider either detecting the Yarn version explicitly or documenting this limitation.

🤖 Prompt for AI Agents
In `@packages/cli-v3/src/commands/update.ts` around lines 261 - 277, The code adds
a yarn-specific --ignore-engines flag unconditionally which breaks on Yarn Berry
(v2+); update the logic around installArgs/packageManager.name so that for
"yarn" you first detect the Yarn major version (e.g., run a quick yarn --version
check or use existing packageManager.version if available) and only push
"--ignore-engines" when major === 1 (Yarn Classic); for Yarn v2+ skip adding the
flag and proceed to call installDependencies({ cwd: projectPath, silent: true,
args: installArgs }) as before.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug: GitHub Integration uses Node 20 for install phase, ignoring runtime config

1 participant